//
// RS Game Framework
// Copyright © 2009 Jedd Haberstro
// jhaberstro@gmail.com
// 
// $Id:
//

#ifndef RS_CONDITION_HPP
#define RS_CONDITION_HPP

#include "rs/Portability.hpp"
#include "rs/SmartPointer.hpp"

namespace rs
{
    namespace internal
    {
        struct ConditionImplementation;
    }
    
    class Mutex;
    class Condition
    {
        friend class internal::ConditionImplementation;
        
    private:
        
        typedef SmartPointer< internal::ConditionImplementation > ConditionImplementationPtr;
        
    public:
        
        Condition();
        
        Condition(Condition const& other);
        
        ~Condition();
        
        void BroadcastSignal();
        
        void Signal();        

        void Wait(Mutex& mutex);
        
        void Swap(Condition& other);
        
        Condition& operator=(Condition const& other);        
        
    private:
        
        ConditionImplementationPtr implementation_;
    };
}

#endif // RS_CONDITION_HPP
